<!DOCTYPE html>
<html lang="en">
#parse('base/head.html')

<body class="no-skin">

<div class="main-container ace-save-state" id="main-container">

    <div class="fp-framework main-content">
        <div class="main-content-inner">
            <div class="page-content">
				<!--
                <div class="page-header">
							
				</div>--><!-- /.page-header -->
				
				<div class="hidden" >
					<input class="col-xs-12 col-sm-10" type="text"  id="form-field-villageId" placeholder="villageId" value="$!{villageInfo.villageId}" />
				</div>
				<div class="row">
					<div class="col-xs-12">
						<!-- PAGE CONTENT BEGINS -->
						
						<div class="row">


							<div class="col-sm-12">
								<div class="widget-box transparent" id="recent-box">
									<div class="widget-header">

										<div class="widget-toolbar no-border" style="float: left;">
											<ul class="nav nav-tabs" id="recent-tab">
												<li class="active">
													<a data-toggle="tab" href="#bfxx-tab" class="tab-title-top">帮扶信息</a>
												</li>

												<li>
													<a data-toggle="tab" href="#pkhlb-tab"  class="tab-title-top">贫困户列表</a>
												</li>

												
											</ul>
										</div>
									</div>
									
									<div class="fp-summary" id="village_family_aidstaff" >

										<div >
											$!{familyAidstaff.villageName}
											&nbsp;共有贫困户:
											$!{familyAidstaff.familyNum}户,工作队成员$!{teamMemberNum}人
										</div>
									</div>
									
									<div class="widget-body">
										<div class="widget-main padding-4">
											<div class="tab-content padding-8">
												<div id="bfxx-tab" class="tab-pane active">
													<div class="row">
														<div class="col-sm-12">
															<div class="col-xs-8">
																<h4 class="widget-title">
																	<i class=""></i>
																	帮扶组织信息
																</h4>
																<div class="profile-user-info profile-user-info-striped" style="width: calc(100%);margin-bottom: 11px!important;" id="village_info_div" >
																	
																	<div class="profile-info-row">
																		<div class="profile-info-name"> 村名 </div>

																		<div class="profile-info-value">
																			<span class="editable" >$!{villageInfo.villageName}</span>
																		</div>
																		<div class="profile-info-name"> 贫困程度 </div>

																		<div class="profile-info-value">
																			<span class="editable" >$!{villageInfo.povertyAttrName}</span>
																		</div>
																		<div class="profile-info-name"> 所属乡镇 </div>

																		<div class="profile-info-value">
																			<span class="editable" >$!{villageInfo.townName}</span>
																		</div>
																	</div>
																	
																	<div class="profile-info-row">
																		<div class="profile-info-name"> 包村旗级单位 </div>

																		<div class="profile-info-value">
																			<span class="editable" >$!{villageInfo.cityOrg}</span>
																		</div>
																		
																		<div class="profile-info-name"> 包村处级领导 </div>

																		<div class="profile-info-value">
																			<span class="editable" >$!{villageInfo.departmentLeader}</span>
																		</div>
																		<div class="profile-info-name"> 包村乡镇领导 </div>

																		<div class="profile-info-value">
																			<span class="editable" >$!{villageInfo.townLeader}</span>
																		</div>
																	</div>
																	
																	<div class="profile-info-row">
																		<div class="profile-info-name"> 第一书记 </div>

																		<div class="profile-info-value">
																			<span class="editable" >$!{villageInfo.villageLeader}</span>
																		</div>
																		
																		<div class="profile-info-name"> 嘎查书记 </div>

																		<div class="profile-info-value">
																			<span class="editable" >$!{villageInfo.gachaSecretary}</span>
																		</div>
																		<div class="profile-info-name"> 嘎查长 </div>

																		<div class="profile-info-value">
																			<span class="editable" >$!{villageInfo.gachaLeader}</span>
																		</div>
																	</div>
																	
																	<div class="profile-info-row">
																		<div class="profile-info-name"> 副嘎查长 </div>

																		<div class="profile-info-value">
																			<span class="editable" >$!{villageInfo.gachaViceLeader}</span>
																		</div>
																		
																		<div class="profile-info-name">  </div>

																		<div class="profile-info-value">
																			<span class="editable" ></span>
																		</div>
																		<div class="profile-info-name">  </div>

																		<div class="profile-info-value">
																			<span class="editable" ></span>
																		</div>
																	</div>

																	#if(${villageInfo.teamCaptain111111})
																	<div class="profile-info-row">
																		<div class="profile-info-name"> 工作队长姓名 </div>
																		<div class="profile-info-value">
																			<span class="editable">$!{villageInfo.teamCaptain}</span>
																		</div>
																		<div class="profile-info-name"> 联系电话 </div>
																		<div class="profile-info-value">
																			<span class="editable">$!{villageInfo.tel}</span>
																		</div>
																		<div class="profile-info-name"> 工作职务 </div>
																		<div class="profile-info-value">
																			<span class="editable">$!{villageInfo.jobTitle}</span>
																		</div>
																	</div>
																	#end
																	#foreach($teamMemberPO in $teamMemberList)
																	<div class="profile-info-row">
																		<div class="profile-info-name"> 工作队队员 </div>
																		<div class="profile-info-value">
																			<span class="editable">$!{teamMemberPO.staffName}</span>
																		</div>
																		<div class="profile-info-name"> 联系电话 </div>
																		<div class="profile-info-value">
																			<span class="editable">$!{teamMemberPO.tel}</span>
																		</div>
																		<div class="profile-info-name"> 工作职务 </div>
																		<div class="profile-info-value">
																			<span class="editable">$!{teamMemberPO.jobTitle}</span>
																		</div>
																	</div>
																	#end
																</div>

															
															</div>
															
															<div class="col-xs-4">
																<h4 class="widget-title">
																	<i class=""></i>
																	帮扶排名
																</h4>

																
																
																<table class="table table-striped table-bordered table-hover">
																	<tbody>
																		#if($visitedOrderResult.size()==0)
																		<tr>
																			<td class="center" colSpan="3">
																				<div  class="" style="font-weight: bold;">没有数据...</div>
																			</td>
																		</tr>
																		#end
																		#foreach($CodeVisitedOrderPO in $visitedOrderResult)
																		<tr>
																			<td class="">$!{CodeVisitedOrderPO.staffName}</td>
																			<td class="">$!{CodeVisitedOrderPO.department}</td>
																			<td class="center">$!{CodeVisitedOrderPO.visitedCountSum}</td>
																		</tr>
																		#end

																	</tbody>
																</table>
																
																
															</div>
														</div>
													</div>
													<div class="row">
														<div class="col-sm-12">
															
															<h4 class="widget-title">
																	<i class=""></i>
																脱贫项目
															</h4>
															<div class="col-sm-12">
																<table id="bfxm-list"></table>
																<div id="bfxm-list-pager"></div>
															</div>
														</div>
													</div>
													
													<div class="row">
														<div class="col-sm-12">
															
															<h4 class="widget-title">
																	<i class=""></i>
																帮扶记录
															</h4>
															<div class="col-sm-12">
																<table id="zfrz-list"></table>
																<div id="zfrz-list-pager"></div>
															</div>
														</div>
													</div>
												</div>

												<div id="pkhlb-tab" class="tab-pane">
													<div class="row">
														<div class="col-sm-12">
															<div class="col-xs-7"></div>
															<div class="col-xs-4 col-sm-4">
																<label class="lineH-34 col-sm-4 control-label no-padding-right" for="form-field-1"> 贫困户名 </label>
																<div class="col-sm-8">
																	<input type="text" id="form-field-1" placeholder="请输入户主名称" class="col-xs-10 col-sm-12" />
																</div>
															</div>
															<div class="col-xs-4 col-sm-1">
																<span class="input-group-btn" >
																	<button type="button" class="btn btn-sm btn-primary" id="pkh-list-btn">
																		<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
																		查询
																	</button>
																</span>
															</div>
														</div>
													</div>
													
													<div class="row">
														<div class="col-sm-12">
															
															<h4 class="widget-title">
																<i class=""></i>
																贫困户列表
															</h4>
															<div class="col-sm-12">
																<table id="pkh-list"></table>
																<div id="pkh-list-pager"></div>
															</div>
														</div>
													</div>

													
												</div><!-- /.#pkhlb-tab -->

												<div id="bfrkh-tab" class="tab-pane">
													

													<div class="hr hr8"></div>


													<div class="hr hr-double hr8"></div>
												</div>
												
												<!-- 模态框（Modal） -->
												<div class="modal fade bs-example-modal-lg" id="pkhDetailModal" tabindex="-1" role="dialog" data-backdrop="true" data-keyboard="false" aria-labelledby="pkh_detail_title_id" aria-hidden="true">
													<div class="modal-dialog modal-lg" >
														
														<div class="modal-content" style="height: 600px;overflow: auto;">
															<div class="modal-header hide">
																<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
																</button>
															</div>
															<div class="modal-body center " style="overflow: auto;">
																<div style="clear:both"></div>
																<div style="height:400px;">
																    <div class="fp-loading">
																     <i class="fa fa-spinner fa-pulse fa-3x"></i>
																     <p>数据加载中，请耐心等待</p>
																    </div>
																</div>
															</div>
															<div class="modal-footer hide">
																
															</div>
														</div><!-- /.modal-content -->
													</div><!-- /.modal -->
												</div>
												
	
												
											</div>
										</div><!-- /.widget-main -->
									</div><!-- /.widget-body -->
								</div><!-- /.widget-box -->
							</div><!-- /.col -->

							
						</div><!-- /.row -->
						
						<div class="hr hr32 hr-dotted"></div>
						
						<!-- PAGE CONTENT ENDS -->
					</div><!-- /.col -->
				</div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div>
	
</div>
#parse('base/footer.html')

		<!-- inline scripts related to this page -->
		<!-- 工作队队员列表 
		<script type="text/javascript">
			var form_width = $("#village_info_div").width();
			
			//resize to fit page size
			$(window).on('resize.jqGrid', function () {
				$("#gzddy-list").jqGrid( 'setGridWidth', form_width-5 );
		    });
			
			$("#gzddy-list").jqGrid({
						url : '$!webPath/fpgzvillage/qryVillageTeam?villageId='+$("#form-field-villageId").val(),
						datatype : "json",
						mtype : 'POST',
						autowidth: true,
						colNames : [ '姓名', '职务', '联系电话'],
						colModel : [ 
							{name : 'staffName',index : 'staffName',width : form_width*0.33}, 
							{name : 'jobTitle',index : 'jobTitle',width : form_width*0.33,sortable : false},
							{name : 'tel',index : 'tel',width : form_width*0.33,sortable : false},
						],
						rowNum : 2000,
						jsonReader : {
							root : "resultList",
							page : "page",
							total : "totalPages",
							records : "totalRecords",
							rows : "resultList"
						},
						scroll : 3,//3行可见
						loadComplete : function() {
							var table = this;
							setTimeout(function(){
								styleCheckbox(table);
								
								updateActionIcons(table);
								updatePagerIcons(table);
								enableTooltips(table);
							}, 0);
							
							$(table).siblings(".norecords").remove(); 
							var rowNum = parseInt($(table).getGridParam("records"), 10);   
						    if (rowNum <= 0) {   
								$(table).parent().append("<div  class=\"norecords\">没有数据...</div>");
								$(table).siblings(".norecords").show(); 								
						    } 
						},
						multiselect : false
						//caption : "工作队队员列表"
				});

		</script>
		-->
		
		<!-- 帮扶记录
		<script type="text/javascript">
		function detailClick_bfjl(rowid){
			console.log("bfjl rowid="+rowid);
		};
		jQuery(function($) {
			var widget_header = $(".widget-header");
			//resize to fit page size
			$(window).on('resize.jqGrid', function () {
				$("#bfjl-list").jqGrid( 'setGridWidth', widget_header.width()-24 );
		    });
			
			
			
			$("#bfjl-list").jqGrid({
						url : '$!webPath/fpgzvillage/qryFamilyAidLog?villageId='+$("#form-field-villageId").val(),
						datatype : "json",
						mtype : 'POST',
						height : 100,
						autowidth: true,
						colNames : [  '日期', '产业分类', '投入项目', '投入金额', '项目说明',' '],
						colModel : [ 
							//{name : 'xh',index : 'xh',width : 50}, 
							{name : 'aidDate',index : 'aidDate',width : 100,sortable : false,
								formatter: function (cellvalue, options, rowObject) {
									
									return cellvalue.slice(0,10);
								}
							},
							{name : 'projectTypeName',index : 'projectTypeName',width : 100,sortable : false},
							{name : 'projectName',index : 'projectName',width : 100,sortable : false},
							{name : 'aidAmount',index : 'aidAmount',width : 100,sortable : false},
							{name : 'projectDesc',index : 'projectDesc',sortable : false},
							{name : 'myac',index : '', width:80, fixed:true, sortable:false, resize:false,
//								formatter:'actions', 
								formatter: function (cellvalue, options, rowObject) {
					
									var detail='<div style="cursor: pointer;">';
									detail += '<i class="normal-icon ace-icon fa fa-eye blue " onclick="detailClick_bfjl(' + options.rowId +')">详细</i>';
									detail += '</div>';
									return detail;
								}
								
							}
							
						],
						rowNum:10,
						rowList:[10,20,30],
						jsonReader : {
							root : "resultList",
							page : "page",
							total : "totalPages",
							records : "totalRecords",
							rows : "resultList"
						},
						pager: '#bfjl-list-pager',
						sortname : 'xh',
						viewrecords : true,
						altRows: true,
						sortorder : "desc",
						loadComplete : function() {
							var table = this;
							setTimeout(function(){
								styleCheckbox(table);
								
								updateActionIcons(table);
								updatePagerIcons(table);
								enableTooltips(table);
							}, 0);
							
							$(table).siblings(".norecords").remove(); 
							var rowNum = parseInt($(table).getGridParam("records"), 10);   
						    if (rowNum <= 0) {   
								$(table).parent().append("<div  class=\"norecords\">没有数据...</div>");
								$(table).siblings(".norecords").show(); 								
						    } 
						},
						multiselect : false
			});
			$(window).triggerHandler('resize.jqGrid');//trigger window resize to make the grid get the correct size
			
			
			
			
		});
		</script> -->

		<!-- 脱贫项目 -->
		<script type="text/javascript">
		function detailClick_bfxm(projectId){
			//window.parent.location.href = ("$!webPath/fpxm/detail?projectId="+projectId);
			//打开模态窗口
			//console.log("清空模态详情");
			$('#pkhDetailModal').children().remove(); 
			//console.log("显示加载信息...");
			$('#pkhDetailModal').append('<div class="modal-dialog modal-lg " ><div class="modal-content" style="height: 600px;overflow: auto;"><div class="modal-header hide"></div><div class="modal-body center " ><div style="clear:both"></div><div style="height:400px;"><div class="fp-loading"><i class="fa fa-spinner fa-pulse fa-3x"></i><p>数据加载中，请耐心等待</p></div></div></div><div class="modal-footer hide"></div></div></div>'); 
			//console.log("加载模态详情")
			$('#pkhDetailModal').modal({keyboard:false,backdrop:true,remote:"$!webPath/fpxm/detail?projectId="+projectId});

		};
		jQuery(function($) {
			var widget_header = $(".widget-header");
			//resize to fit page size
			$(window).on('resize.jqGrid', function () {
				$("#bfxm-list").jqGrid( 'setGridWidth', widget_header.width()-24 );
		    });
			
			
			
			$("#bfxm-list").jqGrid({
						url : '$!webPath/fpgzvillage/qryVillageProjectInfo?villageId='+$("#form-field-villageId").val(),
						datatype : "json",
						mtype : 'POST',
						height : 165,
						width : widget_header.width()-24,
						shrinkToFit:false,
						autowidth: true,
						colNames : [  '日期', '产业分类', '投入项目', '投入金额(元)', '项目说明',' '],
						colModel : [ 
							//{name : 'xh',index : 'xh',width : 50}, 
							{name : 'projectBeginDate',index : 'projectBeginDate',width : 85,sortable : false,
								formatter: function (cellvalue, options, rowObject) {
									
									return cellvalue.slice(0,10);
								}
							},
							{name : 'projectTypeName',index : 'projectTypeName',width : 100,sortable : false},
							{name : 'projectName',index : 'projectName',width : 260,sortable : false},
							{name : 'aidAmount',index : 'aidAmount',width : 120,sortable : false},
							{name : 'projectDesc',index : 'projectDesc',width: widget_header.width()-24-485-160,sortable : false},
							{name : 'myac',index : '', width:80, fixed:true, sortable:false, resize:false,
//								formatter:'actions', 
								formatter: function (cellvalue, options, rowObject) {
					
									var detail='<div style="cursor: pointer;">';
									detail += '<i class="normal-icon ace-icon block-inherit blue " onclick="detailClick_bfxm(' + rowObject.projectId +')">详细</i>';
									detail += '</div>';
									return detail;
								}
								
							}
							
						],
						rowNum:5,
						//rowList:[5,10,20,30],
						rowList:[5],
						jsonReader : {
							root : "resultList",
							page : "page",
							total : "totalPages",
							records : "totalRecords",
							rows : "resultList"
						},
						pager: '#bfxm-list-pager',
						sortname : 'xh',
						viewrecords : true,
						altRows: true,
						sortorder : "desc",
						loadComplete : function() {
							var table = this;
							setTimeout(function(){
								styleCheckbox(table);
								
								updateActionIcons(table);
								updatePagerIcons(table);
								enableTooltips(table);
							}, 0);
							
							$(table).siblings(".norecords").remove(); 
							var rowNum = parseInt($(table).getGridParam("records"), 10);   
						    if (rowNum <= 0) {   
								$(table).parent().append("<div  class=\"norecords\">没有数据...</div>");
								$(table).siblings(".norecords").show(); 								
						    } 
						},
						multiselect : false
			});
			$(window).triggerHandler('resize.jqGrid');//trigger window resize to make the grid get the correct size
			
			
			
			
		});
		</script>
		
		<!-- 帮扶记录 -->
		<script type="text/javascript">
			var widget_header = $(".widget-header");
			//resize to fit page size
			$(window).on('resize.jqGrid', function () {
				$("#zfrz-list").jqGrid( 'setGridWidth', widget_header.width()-24 );
		    });
			function detailClick_zfrz(rowid){
				console.log("zfrz rowid="+rowid);
			};
			$("#zfrz-list").jqGrid({
						url : '$!webPath/fpgzvillage/qryFamilyVisitedLog?villageId='+$("#form-field-villageId").val(),
						datatype : "json",
						mtype : 'POST',
						height : 320,
						autowidth: true,
						colNames : [ '日期', '走访内容', '乡镇','村', '走访照片'],
						colModel : [ 
							//{name : 'xh',index : 'xh',width : 50}, 
							{name : 'visitedDate',index : 'visitedDate',width : 100,sortable : false,
								formatter: function (cellvalue, options, rowObject) {
									
									return cellvalue.slice(0,10);
								}
							},
							{name : 'content',index : 'content',sortable : false},
							{name : 'townName',index : 'townName',width : 100,sortable : false},
							{name : 'villageName',index : 'villageName',width : 100,sortable : false},
							{name : 'photoList',index : 'photoList', editable: false, 
								formatter: function (cellvalue, options, rowObject) {

									if(cellvalue !== null && cellvalue !== undefined && cellvalue !== ''){
									
										var imgPathAry = cellvalue.split(',');
										var detail = '';
										for(var imgPath in imgPathAry){
											console.log(imgPathAry[imgPath]);
											var imgSrcStr = "'"+imgPathAry[imgPath]+"'"
											detail += '<img onclick="getBigImg('+ imgSrcStr +')" src="'+ imgPathAry[imgPath] +'" style="width:50px;height:50px;" />';
										}
										return detail;
									}
									return '';
								} 
							}
							/**
							{name : 'myac',index : '', width:80, fixed:true, sortable:false, resize:false,
//								formatter:'actions', 
								formatter: function (cellvalue, options, rowObject) {
					
									var detail='<div style="cursor: pointer;">';
									detail += '<i class="normal-icon ace-icon fa fa-eye blue " onclick="detailClick_zfrz(' + options.rowId +')">详细</i>';
									detail += '</div>';
									return detail;
								}
								
							}**/
						],
						rowNum:5,
						//rowList:[5,10,20,30],
						rowList:[5],
						jsonReader : {
							root : "resultList",
							page : "page",
							total : "totalPages",
							records : "totalRecords",
							rows : "resultList"
						},
						pager: '#zfrz-list-pager',
						sortname : 'xh',
						viewrecords : true,
						sortorder : "desc",
						loadComplete : function() {
							var table = this;
							setTimeout(function(){
								styleCheckbox(table);
								
								updateActionIcons(table);
								updatePagerIcons(table);
								enableTooltips(table);
							}, 0);

							$(table).siblings(".norecords").remove(); 
							var rowNum = parseInt($(table).getGridParam("records"), 10);   
						    if (rowNum <= 0) {   
								$(table).parent().append("<div  class=\"norecords\">没有数据...</div>");
								$(table).siblings(".norecords").show(); 								
						    } 
						},

						multiselect : false
				});
				$(window).triggerHandler('resize.jqGrid');//trigger window resize to make the grid get the correct size
				
		</script>
	
		<!-- 贫困户列表 -->
		<script type="text/javascript">

			//var pkh_parent_column = $("#pkh-list").closest('[class*="col-"]').closest('h4');
			var widget_header = $(".widget-header");
			//resize to fit page size
			$(window).on('resize.jqGrid', function () {
				$("#pkh-list").jqGrid( 'setGridWidth', widget_header.width()-24 );
		    });
			
			
			

			function detailClick_pkh(rowid,villageId,familyId){
				
				//$("#pkhDetailModal").empty();
				//window.open("$!webPath/fpgzvillage/familyDetail?villageId="+villageId+"&familyId="+familyId); 
				//<div class="modal-dialog modal-lg " ><div class="modal-content" style="height: 600px;overflow: auto;"><div class="modal-header hide"></div><div class="modal-body center " ><div style="clear:both"></div><div style="height:400px;"><div class="fp-loading"><i class="fa fa-spinner fa-pulse fa-3x"></i><p>数据加载中，请耐心等待</p></div></div></div><div class="modal-footer hide"></div></div></div>
				//console.log("清空模态详情");
				$('#pkhDetailModal').children().remove(); 
				//console.log("显示加载信息...");
				$('#pkhDetailModal').append('<div class="modal-dialog modal-lg " ><div class="modal-content" style="height: 600px;overflow: auto;"><div class="modal-header hide"></div><div class="modal-body center " ><div style="clear:both"></div><div style="height:400px;"><div class="fp-loading"><i class="fa fa-spinner fa-pulse fa-3x"></i><p>数据加载中，请耐心等待</p></div></div></div><div class="modal-footer hide"></div></div></div>'); 
				//console.log("加载模态详情")
				$('#pkhDetailModal').modal({keyboard:false,backdrop:true,remote:"$!webPath/fpgzvillage/familyDetail?villageId="+villageId+"&familyId="+familyId});
			};
			$("#pkh-list").jqGrid({
						url : '$!webPath/fpgzvillage/qryFamilyInfo?villageId='+$("#form-field-villageId").val(),
						datatype : "json",
						height : '100%',
						autowidth: true,
						colNames : [  '贫困户名','脱贫状态', '贫困户属性', '是否解决温饱', '是否危房','是否参加新农合','是否参加养老保险','因贫辍学','计划脱贫年度','实际脱贫年度','主要致贫原因','帮扶责任人','帮扶人单位','帮扶次数','走访次数',''],
						colModel : [ 
							//{name : 'xh',index : 'xh',width : 50}, 
							{name : 'personName',index : 'personName',sortable : false},
							{name : 'povertyStateName',index : 'povertyStateName',sortable : false},
							{name : 'povertyAttrName',index : 'povertyAttrName',sortable : false},
							{name : 'isFoodClothingName',index : 'isFoodClothingName',width : 100,sortable : false},
							{name : 'isDangerousName',index : 'isDangerousName',width : 50,sortable : false},
							{name : 'isNrcmsName',index : 'isNrcmsName',width : 100,sortable : false},
							{name : 'isEndowmentName',index : 'isEndowmentName',width : 100,sortable : false},
							{name : 'isDropOutName',index : 'isDropOutName',width : 100,sortable : false},
							{name : 'planShakeOffDate',index : 'planShakeOffDate',width : 100,sortable : false,
								formatter: function (cellvalue, options, rowObject) {
									
									return cellvalue.slice(0,4);
								}
							},
							{name : 'povertyStateDate',index : 'povertyStateDate',width : 100,sortable : false,
								formatter: function (cellvalue, options, rowObject) {
									
									return cellvalue.slice(0,4);
								}
							},
							
							{name : 'mainReasonName',index : 'mainReasonName',sortable : false},
							
							{name : 'aidStaffName',index : 'aidStaffName',width : 100,sortable : false},
							{name : 'aidStaffDepartment',index : 'aidStaffDepartment',width : 100,sortable : false},
							{name : 'aidlogSum',index : 'aidlogSum',width : 100,sortable : false},
							{name : 'vistedSum',index : 'vistedSum',width : 100,sortable : false},
							{name : 'myac',index : '', width:80, fixed:true, sortable:false, resize:false,
//								formatter:'actions', 
								formatter: function (cellvalue, options, rowObject) {
					
									var detail='<div style="cursor: pointer;">';
									detail += '<i class="normal-icon ace-icon block-inherit blue " onclick="detailClick_pkh(' + options.rowId +','+rowObject.villageId+','+rowObject.familyId+')">详细</i>';
									detail += '</div>';
									return detail;
								}
								
							}
						],
						mtype : 'POST',
						postData: {    
							personName: $("#form-field-1").val()  
					    },
						jsonReader : {
							root : "resultList",
							page : "page",
							total : "totalPages",
							records : "totalRecords",
							rows : "resultList"
						},
						rowNum:20,
						rowList:[10,20,50,100],
						pager: '#pkh-list-pager',
						sortname : 'xh',
						viewrecords : true,
						sortorder : "desc",
						loadComplete : function() {
							var table = this;
							setTimeout(function(){
								styleCheckbox(table);
								
								updateActionIcons(table);
								updatePagerIcons(table);
								enableTooltips(table);
							}, 0);
							
							$(table).siblings(".norecords").remove(); 
							var rowNum = parseInt($(table).getGridParam("records"), 10);   
						    if (rowNum <= 0) {   
								$(table).parent().append("<div  class=\"norecords\">没有数据...</div>");
								$(table).siblings(".norecords").show(); 								
						    } 
						},

						multiselect : false
				});
				
			jQuery(function($) {
			
				//v2
				$("#pkhDetailModal").on("hidden", function() {  
					$(this).removeData("modal");  
					console.log("pkhDetailModal hidden ");
					
				});  
				//v3
				$("#pkhDetailModal").on("hidden.bs.modal", function() {  
					$(this).removeData("bs.modal");
					/*modal页面加载$()错误,由于移除缓存时加载到<span style="color: rgb(51, 51, 255);"><div class="modal-content"></div></span>未移除的数据，手动移除加载的内容*/
					$(this).find(".modal-content").children().remove(); 
					console.log("pkhDetailModal hidden.bs.moda ");
				}); 
			
			
				$('#pkh-list-btn').on('click', function() {
					console.log('dddddd');
					$("#pkh-list").jqGrid('setGridParam',{  
						datatype:'json',  
						mtype : 'POST',
						postData:{'personName':$("#form-field-1").val()}, //发送数据  
						page:1  
					}).trigger("reloadGrid"); //重新载入  
				});
			});
		</script>				
		
		<script type="text/javascript">
			jQuery(function($) {
				 

			
				$('.easy-pie-chart.percentage').each(function(){
					var $box = $(this).closest('.infobox');
					var barColor = $(this).data('color') || (!$box.hasClass('infobox-dark') ? $box.css('color') : 'rgba(255,255,255,0.95)');
					var trackColor = barColor == 'rgba(255,255,255,0.95)' ? 'rgba(255,255,255,0.25)' : '#E2E2E2';
					var size = parseInt($(this).data('size')) || 50;
					$(this).easyPieChart({
						barColor: barColor,
						trackColor: trackColor,
						scaleColor: false,
						lineCap: 'butt',
						lineWidth: parseInt(size/10),
						animate: ace.vars['old_ie'] ? false : 1000,
						size: size
					});
				})
			
				$('.sparkline').each(function(){
					var $box = $(this).closest('.infobox');
					var barColor = !$box.hasClass('infobox-dark') ? $box.css('color') : '#FFF';
					$(this).sparkline('html',
									 {
										tagValuesAttribute:'data-values',
										type: 'bar',
										barColor: barColor ,
										chartRangeMin:$(this).data('min') || 0
									 });
				});
			
			
			  //flot chart resize plugin, somehow manipulates default browser resize event to optimize it!
			  //but sometimes it brings up errors with normal resize event handlers
			  $.resize.throttleWindow = false;
			
			  var placeholder = $('#piechart-placeholder').css({'width':'90%' , 'min-height':'150px'});
			  var data = [
				{ label: "social networks",  data: 38.7, color: "#68BC31"},
				{ label: "search engines",  data: 24.5, color: "#2091CF"},
				{ label: "ad campaigns",  data: 8.2, color: "#AF4E96"},
				{ label: "direct traffic",  data: 18.6, color: "#DA5430"},
				{ label: "other",  data: 10, color: "#FEE074"}
			  ]
			  
			

			
			
			  //pie chart tooltip example
			  var t_tooltip = $("<div class='tooltip top in'><div class='tooltip-inner'></div></div>").hide().appendTo('body');
			  var previousPoint = null;
			
			  placeholder.on('plothover', function (event, pos, item) {
				if(item) {
					if (previousPoint != item.seriesIndex) {
						previousPoint = item.seriesIndex;
						var tip = item.series['label'] + " : " + item.series['percent']+'%';
						t_tooltip.show().children(0).text(tip);
					}
					t_tooltip.css({top:pos.pageY + 10, left:pos.pageX + 10});
				} else {
					t_tooltip.hide();
					previousPoint = null;
				}
				
			 });
			
				/////////////////////////////////////
				$(document).one('ajaxloadstart.page', function(e) {
					t_tooltip.remove();
				});
			
			
			
			
				var d1 = [];
				for (var i = 0; i < Math.PI * 2; i += 0.5) {
					d1.push([i, Math.sin(i)]);
				}
			
				var d2 = [];
				for (var i = 0; i < Math.PI * 2; i += 0.5) {
					d2.push([i, Math.cos(i)]);
				}
			
				var d3 = [];
				for (var i = 0; i < Math.PI * 2; i += 0.2) {
					d3.push([i, Math.tan(i)]);
				}
				
			
				var sales_charts = $('#sales-charts').css({'width':'100%' , 'height':'220px'});

			
			
				$('#recent-box [data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('.tab-content')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					//var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			
			
				$('.dialogs,.comments').ace_scroll({
					size: 300
			    });
				
				
				//Android's default browser somehow is confused when tapping on label which will lead to dragging the task
				//so disable dragging when clicking on label
				var agent = navigator.userAgent.toLowerCase();
				if(ace.vars['touch'] && ace.vars['android']) {
				  $('#tasks').on('touchstart', function(e){
					var li = $(e.target).closest('#tasks li');
					if(li.length == 0)return;
					var label = li.find('label.inline').get(0);
					if(label == e.target || $.contains(label, e.target)) e.stopImmediatePropagation() ;
				  });
				}
			
				$('#tasks').sortable({
					opacity:0.8,
					revert:true,
					forceHelperSize:true,
					placeholder: 'draggable-placeholder',
					forcePlaceholderSize:true,
					tolerance:'pointer',
					stop: function( event, ui ) {
						//just for Chrome!!!! so that dropdowns on items don't appear below other items after being moved
						$(ui.item).css('z-index', 'auto');
					}
					}
				);
				$('#tasks').disableSelection();
				$('#tasks input:checkbox').removeAttr('checked').on('click', function(){
					if(this.checked) $(this).closest('li').addClass('selected');
					else $(this).closest('li').removeClass('selected');
				});
			
			
				//show the dropdowns on top or bottom depending on window height and menu position
				$('#bfxx-tab .dropdown-hover').on('mouseenter', function(e) {
					var offset = $(this).offset();
			
					var $w = $(window)
					if (offset.top > $w.scrollTop() + $w.innerHeight() - 100) 
						$(this).addClass('dropup');
					else $(this).removeClass('dropup');
				});
			
			})
		</script>

		<div id="dialog-form" title="图片">
			<img width="400px" height="300px" id="showImgSrc" src="">
		</div>
		<script>
			$("#dialog-form").dialog({
				autoOpen: false,
				height: 400,
				width: 500,
				modal: true
			});
			function getBigImg(src) {
				$("#showImgSrc").attr("src",src)
				$("#dialog-form").dialog('open')
			}
		</script>


</body>
</html>
